from winsound import Beep
import time
import re
import os

def Alarm():
    for i in xrange(1,10):
        for j in xrange(100,1000,10):
            Beep(j*i,10)

def getDone():
    l=re.findall('.*?\.(\d\d\d)\..*?',"".join(os.listdir('.')))
    return len(l)

def getExe():
    for i in os.listdir('.'):
        if i.lower()[-4:]=='.exe':
            return i

def main():
    n=getDone()
    exe=getExe()
    for i in range(n+1,51):
        print("%03d\r" % i)
        os.system(exe)
    Alarm()

if __name__ == "__main__":
    main()
